<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>线程池: lib/src/threads_pool.c 文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">线程池<span id="projectnumber">&#160;1.0.0</span>
   </div>
   <div id="projectbrief">多线程并发工具</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li><li class="navelem"><a class="el" href="dir_a065c5f60305fee3569f887679366939.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#define-members">宏定义</a> &#124;
<a href="#func-members">函数</a>  </div>
  <div class="headertitle"><div class="title">threads_pool.c 文件参考</div></div>
</div><!--header-->
<div class="contents">

<p>线程池模块实现文件  
<a href="#details">更多...</a></p>
<div class="textblock"><code>#include &lt;<a class="el" href="threads__pool_8h_source.html">threads_pool.h</a>&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
threads_pool.c 的引用(Include)关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c__incl.png" border="0" usemap="#alib_2src_2threads__pool_8c" alt=""/></div>
</div>
</div>
<p><a href="threads__pool_8c_source.html">浏览源代码.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
宏定义</h2></td></tr>
<tr class="memitem:a697d5b2708d569fe0575a3b25a809dc1" id="r_a697d5b2708d569fe0575a3b25a809dc1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8c.html#a697d5b2708d569fe0575a3b25a809dc1">__THREADS_POOL_C__</a></td></tr>
<tr class="separator:a697d5b2708d569fe0575a3b25a809dc1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:ac81554b51840bdab1350772eb599c27b" id="r_ac81554b51840bdab1350772eb599c27b"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8c.html#ac81554b51840bdab1350772eb599c27b">cleanUpHandle</a> (void *arg)</td></tr>
<tr class="memdesc:ac81554b51840bdab1350772eb599c27b"><td class="mdescLeft">&#160;</td><td class="mdescRight">清理处理函数  <br /></td></tr>
<tr class="separator:ac81554b51840bdab1350772eb599c27b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4ebf31958db9354ac6dcdb000e723303" id="r_a4ebf31958db9354ac6dcdb000e723303"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="threads__pool_8h.html#abf857be8d505f4cc5457764683476a96">TaskMsg_st_pt</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8c.html#a4ebf31958db9354ac6dcdb000e723303">getNewTaskMsg</a> (void *(*handleFuncPt)(void *arg), void *handleFuncArg)</td></tr>
<tr class="memdesc:a4ebf31958db9354ac6dcdb000e723303"><td class="mdescLeft">&#160;</td><td class="mdescRight">创建新的任务信息  <br /></td></tr>
<tr class="separator:a4ebf31958db9354ac6dcdb000e723303"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab8f5739158324ca3499012ae04bce8cd" id="r_ab8f5739158324ca3499012ae04bce8cd"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8c.html#ab8f5739158324ca3499012ae04bce8cd">inqueueNewTaskMsg</a> (<a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt, <a class="el" href="threads__pool_8h.html#abf857be8d505f4cc5457764683476a96">TaskMsg_st_pt</a> newTaskMsgStPt)</td></tr>
<tr class="memdesc:ab8f5739158324ca3499012ae04bce8cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">将新任务信息加入队列  <br /></td></tr>
<tr class="separator:ab8f5739158324ca3499012ae04bce8cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af90c938ee855b735b0c0b9f82f9e6d67" id="r_af90c938ee855b735b0c0b9f82f9e6d67"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="threads__pool_8h.html#abf857be8d505f4cc5457764683476a96">TaskMsg_st_pt</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8c.html#af90c938ee855b735b0c0b9f82f9e6d67">dequeueTaskMsg</a> (<a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt)</td></tr>
<tr class="memdesc:af90c938ee855b735b0c0b9f82f9e6d67"><td class="mdescLeft">&#160;</td><td class="mdescRight">从队列中取出任务信息  <br /></td></tr>
<tr class="separator:af90c938ee855b735b0c0b9f82f9e6d67"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a38ce3bf239e8daae72e3d7f7fc66a7" id="r_a8a38ce3bf239e8daae72e3d7f7fc66a7"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8c.html#a8a38ce3bf239e8daae72e3d7f7fc66a7">removeDestTaskMsg</a> (<a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt, void *(*destHandleFuncPt)(void *arg))</td></tr>
<tr class="memdesc:a8a38ce3bf239e8daae72e3d7f7fc66a7"><td class="mdescLeft">&#160;</td><td class="mdescRight">移除指定任务信息  <br /></td></tr>
<tr class="separator:a8a38ce3bf239e8daae72e3d7f7fc66a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a649af44a3d418d82c8be4cc9e28be41d" id="r_a649af44a3d418d82c8be4cc9e28be41d"><td class="memItemLeft" align="right" valign="top">static void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8c.html#a649af44a3d418d82c8be4cc9e28be41d">threadRoutine</a> (void *arg)</td></tr>
<tr class="memdesc:a649af44a3d418d82c8be4cc9e28be41d"><td class="mdescLeft">&#160;</td><td class="mdescRight">线程例程函数  <br /></td></tr>
<tr class="separator:a649af44a3d418d82c8be4cc9e28be41d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6c30c7bb23d59ef4146a65f8fc66976f" id="r_a6c30c7bb23d59ef4146a65f8fc66976f"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="threads__pool_8h.html#ae4d780691b4e7bc3472f4612e32a9c58">ThreadMsg_st_pt</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8c.html#a6c30c7bb23d59ef4146a65f8fc66976f">getNewThreadMsg</a> (<a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt)</td></tr>
<tr class="memdesc:a6c30c7bb23d59ef4146a65f8fc66976f"><td class="mdescLeft">&#160;</td><td class="mdescRight">创建新的线程信息  <br /></td></tr>
<tr class="separator:a6c30c7bb23d59ef4146a65f8fc66976f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a230969f5746c1add90070d33c4ac7092" id="r_a230969f5746c1add90070d33c4ac7092"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8c.html#a230969f5746c1add90070d33c4ac7092">insertNewThreadMsg</a> (<a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt, <a class="el" href="threads__pool_8h.html#ae4d780691b4e7bc3472f4612e32a9c58">ThreadMsg_st_pt</a> newTrdMsgStPt)</td></tr>
<tr class="memdesc:a230969f5746c1add90070d33c4ac7092"><td class="mdescLeft">&#160;</td><td class="mdescRight">插入新线程信息到链表  <br /></td></tr>
<tr class="separator:a230969f5746c1add90070d33c4ac7092"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a14fc4d285be60008c10b4c2520d770f4" id="r_a14fc4d285be60008c10b4c2520d770f4"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8c.html#a14fc4d285be60008c10b4c2520d770f4">removeThreadMsg</a> (<a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt)</td></tr>
<tr class="memdesc:a14fc4d285be60008c10b4c2520d770f4"><td class="mdescLeft">&#160;</td><td class="mdescRight">从链表中移除线程信息  <br /></td></tr>
<tr class="separator:a14fc4d285be60008c10b4c2520d770f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9fd17f658f3015bed2089a4acd9dda5a" id="r_a9fd17f658f3015bed2089a4acd9dda5a"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8c.html#a9fd17f658f3015bed2089a4acd9dda5a">insertSomeNewThreadMsgs</a> (<a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt, int newTrdMSgsCot)</td></tr>
<tr class="memdesc:a9fd17f658f3015bed2089a4acd9dda5a"><td class="mdescLeft">&#160;</td><td class="mdescRight">批量插入新线程信息  <br /></td></tr>
<tr class="separator:a9fd17f658f3015bed2089a4acd9dda5a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a871605529dee3dac1537de63589ab108" id="r_a871605529dee3dac1537de63589ab108"><td class="memItemLeft" align="right" valign="top"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8c.html#a871605529dee3dac1537de63589ab108">getNewThreadsPoolMsg</a> (int orgActiveThreadsCot, int maxWaitingTasksCot, int maxActiveThreadsCot)</td></tr>
<tr class="memdesc:a871605529dee3dac1537de63589ab108"><td class="mdescLeft">&#160;</td><td class="mdescRight">创建新的线程池  <br /></td></tr>
<tr class="separator:a871605529dee3dac1537de63589ab108"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ceec63a2e1c63606f561486b0b24e72" id="r_a3ceec63a2e1c63606f561486b0b24e72"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8c.html#a3ceec63a2e1c63606f561486b0b24e72">addNewTask</a> (<a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt, void *(*handleFuncPt)(void *arg), void *handleFuncArg)</td></tr>
<tr class="memdesc:a3ceec63a2e1c63606f561486b0b24e72"><td class="mdescLeft">&#160;</td><td class="mdescRight">添加新任务到线程池  <br /></td></tr>
<tr class="separator:a3ceec63a2e1c63606f561486b0b24e72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ebefc9eea4454da73914b2e62c3ef54" id="r_a7ebefc9eea4454da73914b2e62c3ef54"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8c.html#a7ebefc9eea4454da73914b2e62c3ef54">reduceTask</a> (<a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt, void *(*destHandleFuncPt)(void *arg))</td></tr>
<tr class="memdesc:a7ebefc9eea4454da73914b2e62c3ef54"><td class="mdescLeft">&#160;</td><td class="mdescRight">从线程池中移除指定任务  <br /></td></tr>
<tr class="separator:a7ebefc9eea4454da73914b2e62c3ef54"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c97656e7bb9d4709eca4ed29abf9d9c" id="r_a3c97656e7bb9d4709eca4ed29abf9d9c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8c.html#a3c97656e7bb9d4709eca4ed29abf9d9c">addThread</a> (<a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt)</td></tr>
<tr class="memdesc:a3c97656e7bb9d4709eca4ed29abf9d9c"><td class="mdescLeft">&#160;</td><td class="mdescRight">向线程池中添加新线程  <br /></td></tr>
<tr class="separator:a3c97656e7bb9d4709eca4ed29abf9d9c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afbfdf354a44f65186b3dfdd80e566b59" id="r_afbfdf354a44f65186b3dfdd80e566b59"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8c.html#afbfdf354a44f65186b3dfdd80e566b59">reduceThread</a> (<a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt)</td></tr>
<tr class="memdesc:afbfdf354a44f65186b3dfdd80e566b59"><td class="mdescLeft">&#160;</td><td class="mdescRight">从线程池中移除线程  <br /></td></tr>
<tr class="separator:afbfdf354a44f65186b3dfdd80e566b59"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad05cdcc30cc4fd66e4ff890ea5cb570" id="r_aad05cdcc30cc4fd66e4ff890ea5cb570"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8c.html#aad05cdcc30cc4fd66e4ff890ea5cb570">destroyThreadMsgsLinkedList</a> (<a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt)</td></tr>
<tr class="memdesc:aad05cdcc30cc4fd66e4ff890ea5cb570"><td class="mdescLeft">&#160;</td><td class="mdescRight">销毁线程信息链表  <br /></td></tr>
<tr class="separator:aad05cdcc30cc4fd66e4ff890ea5cb570"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af6ab15dabb1e0688a886e468d0f0b577" id="r_af6ab15dabb1e0688a886e468d0f0b577"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8c.html#af6ab15dabb1e0688a886e468d0f0b577">destroyTaskMsgsLinkedQueue</a> (<a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt)</td></tr>
<tr class="memdesc:af6ab15dabb1e0688a886e468d0f0b577"><td class="mdescLeft">&#160;</td><td class="mdescRight">销毁任务信息队列  <br /></td></tr>
<tr class="separator:af6ab15dabb1e0688a886e468d0f0b577"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9ebf8832444bfb71e5cc1549ec38e354" id="r_a9ebf8832444bfb71e5cc1549ec38e354"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="threads__pool_8c.html#a9ebf8832444bfb71e5cc1549ec38e354">destroyThreadsPoolMsg</a> (<a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt)</td></tr>
<tr class="memdesc:a9ebf8832444bfb71e5cc1549ec38e354"><td class="mdescLeft">&#160;</td><td class="mdescRight">销毁线程池  <br /></td></tr>
<tr class="separator:a9ebf8832444bfb71e5cc1549ec38e354"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>线程池模块实现文件 </p>
<p>实现了线程池的核心功能，包括线程管理、任务调度、资源清理等</p>
<dl class="section author"><dt>作者</dt><dd>连佳炜 </dd></dl>
<dl class="section date"><dt>日期</dt><dd>2025-09-12 </dd></dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 中定义.</p>
</div><h2 class="groupheader">宏定义说明</h2>
<a id="a697d5b2708d569fe0575a3b25a809dc1" name="a697d5b2708d569fe0575a3b25a809dc1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a697d5b2708d569fe0575a3b25a809dc1">&#9670;&#160;</a></span>__THREADS_POOL_C__</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define __THREADS_POOL_C__</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00012">12</a> 行定义.</p>

</div>
</div>
<h2 class="groupheader">函数说明</h2>
<a id="a3ceec63a2e1c63606f561486b0b24e72" name="a3ceec63a2e1c63606f561486b0b24e72"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3ceec63a2e1c63606f561486b0b24e72">&#9670;&#160;</a></span>addNewTask()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int addNewTask </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>trdsPolMsgStPt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *(*)(void *arg)&#160;</td>
          <td class="paramname"><em>handleFuncPt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>handleFuncArg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>添加新任务到线程池 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池指针 </td></tr>
    <tr><td class="paramname">handleFuncPt</td><td>任务处理函数指针 </td></tr>
    <tr><td class="paramname">handleFuncArg</td><td>任务处理函数参数</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回0，失败返回-1</dd></dl>
<dl class="section note"><dt>注解</dt><dd>如果任务队列已满，添加会失败 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池信息地址  </td></tr>
    <tr><td class="paramname">handleFuncPt</td><td>处理函数地址  </td></tr>
    <tr><td class="paramname">handleFuncArg</td><td>处理函数参数 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00396">396</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8c_source.html#l00025">cleanUpHandle()</a>, <a class="el" href="threads__pool_8h_source.html#l00061">threadsPoolMsg::codUn</a>, <a class="el" href="threads__pool_8c_source.html#l00050">getNewTaskMsg()</a>, <a class="el" href="threads__pool_8c_source.html#l00079">inqueueNewTaskMsg()</a>, <a class="el" href="threads__pool_8h_source.html#l00065">threadsPoolMsg::maxWaitingTasksCot</a>, <a class="el" href="threads__pool_8h_source.html#l00060">threadsPoolMsg::mtxUn</a>, <a class="el" href="threads__pool_8h_source.html#l00080">READY_CLEAN_UP_AND_LOCK</a>, <a class="el" href="threads__pool_8h_source.html#l00091">UNLOCK_AND_CANCEL_CLEAN_UP</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00063">threadsPoolMsg::waitingTasksCot</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool__test_8c_source.html#l00033">main()</a>.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_a3ceec63a2e1c63606f561486b0b24e72_cgraph.png" border="0" usemap="#athreads__pool_8c_a3ceec63a2e1c63606f561486b0b24e72_cgraph" alt=""/></div>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_a3ceec63a2e1c63606f561486b0b24e72_icgraph.png" border="0" usemap="#athreads__pool_8c_a3ceec63a2e1c63606f561486b0b24e72_icgraph" alt=""/></div>
</div>

</div>
</div>
<a id="a3c97656e7bb9d4709eca4ed29abf9d9c" name="a3c97656e7bb9d4709eca4ed29abf9d9c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3c97656e7bb9d4709eca4ed29abf9d9c">&#9670;&#160;</a></span>addThread()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int addThread </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>trdsPolMsgStPt</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>向线程池中添加新线程 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池指针</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回0，失败返回-1</dd></dl>
<dl class="section note"><dt>注解</dt><dd>线程数量不能超过最大限制 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池信息地址 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00456">456</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8h_source.html#l00064">threadsPoolMsg::activeThreadsCot</a>, <a class="el" href="threads__pool_8c_source.html#l00025">cleanUpHandle()</a>, <a class="el" href="threads__pool_8c_source.html#l00245">getNewThreadMsg()</a>, <a class="el" href="threads__pool_8c_source.html#l00276">insertNewThreadMsg()</a>, <a class="el" href="threads__pool_8h_source.html#l00066">threadsPoolMsg::maxActiveThreadsCot</a>, <a class="el" href="threads__pool_8h_source.html#l00060">threadsPoolMsg::mtxUn</a>, <a class="el" href="threads__pool_8h_source.html#l00080">READY_CLEAN_UP_AND_LOCK</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00091">UNLOCK_AND_CANCEL_CLEAN_UP</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool__test_8c_source.html#l00033">main()</a>.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_a3c97656e7bb9d4709eca4ed29abf9d9c_cgraph.png" border="0" usemap="#athreads__pool_8c_a3c97656e7bb9d4709eca4ed29abf9d9c_cgraph" alt=""/></div>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_a3c97656e7bb9d4709eca4ed29abf9d9c_icgraph.png" border="0" usemap="#athreads__pool_8c_a3c97656e7bb9d4709eca4ed29abf9d9c_icgraph" alt=""/></div>
</div>

</div>
</div>
<a id="ac81554b51840bdab1350772eb599c27b" name="ac81554b51840bdab1350772eb599c27b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac81554b51840bdab1350772eb599c27b">&#9670;&#160;</a></span>cleanUpHandle()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void cleanUpHandle </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>清理处理函数 </p>
<p>线程取消时自动调用的清理函数，用于确保互斥锁被正确释放</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">arg</td><td>互斥锁指针</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>此函数由pthread_cleanup_push/pop机制自动调用 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">arg</td><td>函数参数（互斥锁地址） </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00025">25</a> 行定义.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool_8c_source.html#l00396">addNewTask()</a>, <a class="el" href="threads__pool_8c_source.html#l00456">addThread()</a>, <a class="el" href="threads__pool_8c_source.html#l00431">reduceTask()</a>, <a class="el" href="threads__pool_8c_source.html#l00486">reduceThread()</a> , 以及 <a class="el" href="threads__pool_8c_source.html#l00185">threadRoutine()</a>.</p>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_ac81554b51840bdab1350772eb599c27b_icgraph.png" border="0" usemap="#athreads__pool_8c_ac81554b51840bdab1350772eb599c27b_icgraph" alt=""/></div>
</div>

</div>
</div>
<a id="af90c938ee855b735b0c0b9f82f9e6d67" name="af90c938ee855b735b0c0b9f82f9e6d67"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af90c938ee855b735b0c0b9f82f9e6d67">&#9670;&#160;</a></span>dequeueTaskMsg()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="threads__pool_8h.html#abf857be8d505f4cc5457764683476a96">TaskMsg_st_pt</a> dequeueTaskMsg </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>trdsPolMsgStPt</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>从队列中取出任务信息 </p>
<p>从任务队列的头部取出一个任务信息</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">trdsPolMsgStPt</td><td>线程池指针</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>取出的任务信息指针</dd></dl>
<dl class="section note"><dt>注解</dt><dd>此函数假设调用者已持有线程池锁 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池地址 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00103">103</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8h_source.html#l00036">taskMsg::nextTaskMsgStPt</a>, <a class="el" href="threads__pool_8h_source.html#l00035">taskMsg::prevTaskMsgStPt</a>, <a class="el" href="threads__pool_8h_source.html#l00067">threadsPoolMsg::tasksLinkedQueueEntr</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00063">threadsPoolMsg::waitingTasksCot</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool_8c_source.html#l00535">destroyTaskMsgsLinkedQueue()</a> , 以及 <a class="el" href="threads__pool_8c_source.html#l00185">threadRoutine()</a>.</p>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_af90c938ee855b735b0c0b9f82f9e6d67_icgraph.png" border="0" usemap="#athreads__pool_8c_af90c938ee855b735b0c0b9f82f9e6d67_icgraph" alt=""/></div>
</div>

</div>
</div>
<a id="af6ab15dabb1e0688a886e468d0f0b577" name="af6ab15dabb1e0688a886e468d0f0b577"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af6ab15dabb1e0688a886e468d0f0b577">&#9670;&#160;</a></span>destroyTaskMsgsLinkedQueue()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void destroyTaskMsgsLinkedQueue </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>trdsPolMsgStPt</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>销毁任务信息队列 </p>
<p>清理所有未执行的任务资源</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">trdsPolMsgStPt</td><td>线程池指针 </td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池信息地址 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00535">535</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8c_source.html#l00103">dequeueTaskMsg()</a>, <a class="el" href="threads__pool_8h_source.html#l00067">threadsPoolMsg::tasksLinkedQueueEntr</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00063">threadsPoolMsg::waitingTasksCot</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool_8c_source.html#l00556">destroyThreadsPoolMsg()</a>.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_af6ab15dabb1e0688a886e468d0f0b577_cgraph.png" border="0" usemap="#athreads__pool_8c_af6ab15dabb1e0688a886e468d0f0b577_cgraph" alt=""/></div>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_af6ab15dabb1e0688a886e468d0f0b577_icgraph.png" border="0" usemap="#athreads__pool_8c_af6ab15dabb1e0688a886e468d0f0b577_icgraph" alt=""/></div>
</div>

</div>
</div>
<a id="aad05cdcc30cc4fd66e4ff890ea5cb570" name="aad05cdcc30cc4fd66e4ff890ea5cb570"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aad05cdcc30cc4fd66e4ff890ea5cb570">&#9670;&#160;</a></span>destroyThreadMsgsLinkedList()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void destroyThreadMsgsLinkedList </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>trdsPolMsgStPt</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>销毁线程信息链表 </p>
<p>清理所有线程资源，等待线程退出</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">trdsPolMsgStPt</td><td>线程池指针 </td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池信息地址 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00513">513</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8h_source.html#l00064">threadsPoolMsg::activeThreadsCot</a>, <a class="el" href="threads__pool_8h_source.html#l00061">threadsPoolMsg::codUn</a>, <a class="el" href="threads__pool_8c_source.html#l00298">removeThreadMsg()</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00068">threadsPoolMsg::threadsLinkedListEntr</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool_8c_source.html#l00556">destroyThreadsPoolMsg()</a>.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_aad05cdcc30cc4fd66e4ff890ea5cb570_cgraph.png" border="0" usemap="#athreads__pool_8c_aad05cdcc30cc4fd66e4ff890ea5cb570_cgraph" alt=""/></div>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_aad05cdcc30cc4fd66e4ff890ea5cb570_icgraph.png" border="0" usemap="#athreads__pool_8c_aad05cdcc30cc4fd66e4ff890ea5cb570_icgraph" alt=""/></div>
</div>

</div>
</div>
<a id="a9ebf8832444bfb71e5cc1549ec38e354" name="a9ebf8832444bfb71e5cc1549ec38e354"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9ebf8832444bfb71e5cc1549ec38e354">&#9670;&#160;</a></span>destroyThreadsPoolMsg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void destroyThreadsPoolMsg </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>trdsPolMsgStPt</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>销毁线程池 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池指针</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>会等待所有任务完成后再销毁资源 </dd></dl>
<dl class="section warning"><dt>警告</dt><dd>线程池销毁后不能再使用 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池信息地址 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00556">556</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8h_source.html#l00061">threadsPoolMsg::codUn</a>, <a class="el" href="threads__pool_8c_source.html#l00535">destroyTaskMsgsLinkedQueue()</a>, <a class="el" href="threads__pool_8c_source.html#l00513">destroyThreadMsgsLinkedList()</a>, <a class="el" href="threads__pool_8h_source.html#l00060">threadsPoolMsg::mtxUn</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00062">threadsPoolMsg::shutDown</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool__test_8c_source.html#l00033">main()</a>.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_a9ebf8832444bfb71e5cc1549ec38e354_cgraph.png" border="0" usemap="#athreads__pool_8c_a9ebf8832444bfb71e5cc1549ec38e354_cgraph" alt=""/></div>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_a9ebf8832444bfb71e5cc1549ec38e354_icgraph.png" border="0" usemap="#athreads__pool_8c_a9ebf8832444bfb71e5cc1549ec38e354_icgraph" alt=""/></div>
</div>

</div>
</div>
<a id="a4ebf31958db9354ac6dcdb000e723303" name="a4ebf31958db9354ac6dcdb000e723303"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4ebf31958db9354ac6dcdb000e723303">&#9670;&#160;</a></span>getNewTaskMsg()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="threads__pool_8h.html#abf857be8d505f4cc5457764683476a96">TaskMsg_st_pt</a> getNewTaskMsg </td>
          <td>(</td>
          <td class="paramtype">void *(*)(void *arg)&#160;</td>
          <td class="paramname"><em>handleFuncPt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>handleFuncArg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>创建新的任务信息 </p>
<p>分配并初始化一个新的任务信息结构体</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">handleFuncPt</td><td>任务处理函数指针 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">handleFuncArg</td><td>任务处理函数参数</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回任务信息指针，失败返回NULL</dd></dl>
<dl class="section note"><dt>注解</dt><dd>返回的任务信息需要手动释放内存 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">handleFuncPt</td><td>处理函数地址  </td></tr>
    <tr><td class="paramname">handleFuncArg</td><td>处理函数参数 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00050">50</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8h_source.html#l00034">taskMsg::handleFuncArg</a>, <a class="el" href="threads__pool_8h_source.html#l00033">taskMsg::handleFuncPt</a>, <a class="el" href="threads__pool_8h_source.html#l00036">taskMsg::nextTaskMsgStPt</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00035">taskMsg::prevTaskMsgStPt</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool_8c_source.html#l00396">addNewTask()</a> , 以及 <a class="el" href="threads__pool_8c_source.html#l00366">getNewThreadsPoolMsg()</a>.</p>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_a4ebf31958db9354ac6dcdb000e723303_icgraph.png" border="0" usemap="#athreads__pool_8c_a4ebf31958db9354ac6dcdb000e723303_icgraph" alt=""/></div>
</div>

</div>
</div>
<a id="a6c30c7bb23d59ef4146a65f8fc66976f" name="a6c30c7bb23d59ef4146a65f8fc66976f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6c30c7bb23d59ef4146a65f8fc66976f">&#9670;&#160;</a></span>getNewThreadMsg()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="threads__pool_8h.html#ae4d780691b4e7bc3472f4612e32a9c58">ThreadMsg_st_pt</a> getNewThreadMsg </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>trdsPolMsgStPt</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>创建新的线程信息 </p>
<p>分配并初始化一个新的线程信息结构体</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">trdsPolMsgStPt</td><td>线程池指针</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回线程信息指针，失败返回NULL</dd></dl>
<dl class="section note"><dt>注解</dt><dd>如果线程池指针不为NULL，会创建并启动新线程 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池信息地址 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00245">245</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8h_source.html#l00049">threadMsg::nextTrdMsgStPt</a>, <a class="el" href="threads__pool_8h_source.html#l00048">threadMsg::prevTrdMsgStPt</a>, <a class="el" href="threads__pool_8c_source.html#l00185">threadRoutine()</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00047">threadMsg::tid</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool_8c_source.html#l00456">addThread()</a>, <a class="el" href="threads__pool_8c_source.html#l00366">getNewThreadsPoolMsg()</a> , 以及 <a class="el" href="threads__pool_8c_source.html#l00341">insertSomeNewThreadMsgs()</a>.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_a6c30c7bb23d59ef4146a65f8fc66976f_cgraph.png" border="0" usemap="#athreads__pool_8c_a6c30c7bb23d59ef4146a65f8fc66976f_cgraph" alt=""/></div>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_a6c30c7bb23d59ef4146a65f8fc66976f_icgraph.png" border="0" usemap="#athreads__pool_8c_a6c30c7bb23d59ef4146a65f8fc66976f_icgraph" alt=""/></div>
</div>

</div>
</div>
<a id="a871605529dee3dac1537de63589ab108" name="a871605529dee3dac1537de63589ab108"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a871605529dee3dac1537de63589ab108">&#9670;&#160;</a></span>getNewThreadsPoolMsg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a> getNewThreadsPoolMsg </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>orgActiveThreadsCot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>maxWaitingTasksCot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>maxActiveThreadsCot</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>创建新的线程池 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">orgActiveThreadsCot</td><td>初始活跃线程数量 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">maxWaitingTasksCot</td><td>最大等待任务数量 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">maxActiveThreadsCot</td><td>最大活跃线程数量</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回线程池指针，失败返回NULL </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">orgActiveThreadsCot</td><td>初始活跃线程量  </td></tr>
    <tr><td class="paramname">maxWaitingTasksCot</td><td>最大等待任务量  </td></tr>
    <tr><td class="paramname">maxActiveThreadsCot</td><td>最大活跃线程量 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00366">366</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8h_source.html#l00064">threadsPoolMsg::activeThreadsCot</a>, <a class="el" href="threads__pool_8h_source.html#l00061">threadsPoolMsg::codUn</a>, <a class="el" href="threads__pool_8c_source.html#l00050">getNewTaskMsg()</a>, <a class="el" href="threads__pool_8c_source.html#l00245">getNewThreadMsg()</a>, <a class="el" href="threads__pool_8c_source.html#l00341">insertSomeNewThreadMsgs()</a>, <a class="el" href="threads__pool_8h_source.html#l00066">threadsPoolMsg::maxActiveThreadsCot</a>, <a class="el" href="threads__pool_8h_source.html#l00065">threadsPoolMsg::maxWaitingTasksCot</a>, <a class="el" href="threads__pool_8h_source.html#l00060">threadsPoolMsg::mtxUn</a>, <a class="el" href="threads__pool_8h_source.html#l00062">threadsPoolMsg::shutDown</a>, <a class="el" href="threads__pool_8h_source.html#l00067">threadsPoolMsg::tasksLinkedQueueEntr</a>, <a class="el" href="threads__pool_8h_source.html#l00068">threadsPoolMsg::threadsLinkedListEntr</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00063">threadsPoolMsg::waitingTasksCot</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool__test_8c_source.html#l00033">main()</a>.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_a871605529dee3dac1537de63589ab108_cgraph.png" border="0" usemap="#athreads__pool_8c_a871605529dee3dac1537de63589ab108_cgraph" alt=""/></div>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_a871605529dee3dac1537de63589ab108_icgraph.png" border="0" usemap="#athreads__pool_8c_a871605529dee3dac1537de63589ab108_icgraph" alt=""/></div>
</div>

</div>
</div>
<a id="ab8f5739158324ca3499012ae04bce8cd" name="ab8f5739158324ca3499012ae04bce8cd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab8f5739158324ca3499012ae04bce8cd">&#9670;&#160;</a></span>inqueueNewTaskMsg()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void inqueueNewTaskMsg </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>trdsPolMsgStPt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#abf857be8d505f4cc5457764683476a96">TaskMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>newTaskMsgStPt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>将新任务信息加入队列 </p>
<p>将任务信息添加到任务队列的尾部</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">trdsPolMsgStPt</td><td>线程池指针 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">newTaskMsgStPt</td><td>新任务信息指针</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>此函数假设调用者已持有线程池锁 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池地址  </td></tr>
    <tr><td class="paramname">newTaskMsgStPt</td><td>新任务信息地址 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00079">79</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8h_source.html#l00036">taskMsg::nextTaskMsgStPt</a>, <a class="el" href="threads__pool_8h_source.html#l00035">taskMsg::prevTaskMsgStPt</a>, <a class="el" href="threads__pool_8h_source.html#l00067">threadsPoolMsg::tasksLinkedQueueEntr</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00063">threadsPoolMsg::waitingTasksCot</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool_8c_source.html#l00396">addNewTask()</a>.</p>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_ab8f5739158324ca3499012ae04bce8cd_icgraph.png" border="0" usemap="#athreads__pool_8c_ab8f5739158324ca3499012ae04bce8cd_icgraph" alt=""/></div>
</div>

</div>
</div>
<a id="a230969f5746c1add90070d33c4ac7092" name="a230969f5746c1add90070d33c4ac7092"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a230969f5746c1add90070d33c4ac7092">&#9670;&#160;</a></span>insertNewThreadMsg()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void insertNewThreadMsg </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>trdsPolMsgStPt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#ae4d780691b4e7bc3472f4612e32a9c58">ThreadMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>newTrdMsgStPt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>插入新线程信息到链表 </p>
<p>将线程信息添加到线程链表的尾部</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">trdsPolMsgStPt</td><td>线程池指针 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">newTrdMsgStPt</td><td>新线程信息指针</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>此函数假设调用者已持有线程池锁 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池信息地址  </td></tr>
    <tr><td class="paramname">newTrdMsgStPt</td><td>新线程信息地址 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00276">276</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8h_source.html#l00064">threadsPoolMsg::activeThreadsCot</a>, <a class="el" href="threads__pool_8h_source.html#l00049">threadMsg::nextTrdMsgStPt</a>, <a class="el" href="threads__pool_8h_source.html#l00048">threadMsg::prevTrdMsgStPt</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00068">threadsPoolMsg::threadsLinkedListEntr</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool_8c_source.html#l00456">addThread()</a> , 以及 <a class="el" href="threads__pool_8c_source.html#l00341">insertSomeNewThreadMsgs()</a>.</p>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_a230969f5746c1add90070d33c4ac7092_icgraph.png" border="0" usemap="#athreads__pool_8c_a230969f5746c1add90070d33c4ac7092_icgraph" alt=""/></div>
</div>

</div>
</div>
<a id="a9fd17f658f3015bed2089a4acd9dda5a" name="a9fd17f658f3015bed2089a4acd9dda5a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9fd17f658f3015bed2089a4acd9dda5a">&#9670;&#160;</a></span>insertSomeNewThreadMsgs()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void insertSomeNewThreadMsgs </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>trdsPolMsgStPt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>newTrdMSgsCot</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>批量插入新线程信息 </p>
<p>创建并插入指定数量的新线程到线程池</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">trdsPolMsgStPt</td><td>线程池指针 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">newTrdMSgsCot</td><td>要添加的新线程数量</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>此函数假设调用者已持有线程池锁 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池信息地址  </td></tr>
    <tr><td class="paramname">newTrdMSgsCot</td><td>新线程信息量 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00341">341</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8c_source.html#l00245">getNewThreadMsg()</a> , 以及 <a class="el" href="threads__pool_8c_source.html#l00276">insertNewThreadMsg()</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool_8c_source.html#l00366">getNewThreadsPoolMsg()</a>.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_a9fd17f658f3015bed2089a4acd9dda5a_cgraph.png" border="0" usemap="#athreads__pool_8c_a9fd17f658f3015bed2089a4acd9dda5a_cgraph" alt=""/></div>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_a9fd17f658f3015bed2089a4acd9dda5a_icgraph.png" border="0" usemap="#athreads__pool_8c_a9fd17f658f3015bed2089a4acd9dda5a_icgraph" alt=""/></div>
</div>

</div>
</div>
<a id="a7ebefc9eea4454da73914b2e62c3ef54" name="a7ebefc9eea4454da73914b2e62c3ef54"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7ebefc9eea4454da73914b2e62c3ef54">&#9670;&#160;</a></span>reduceTask()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int reduceTask </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>trdsPolMsgStPt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *(*)(void *arg)&#160;</td>
          <td class="paramname"><em>destHandleFuncPt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>从线程池中移除指定任务 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池指针 </td></tr>
    <tr><td class="paramname">destHandleFuncPt</td><td>要移除的任务处理函数指针</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回0，失败返回-1</dd></dl>
<dl class="section note"><dt>注解</dt><dd>只能移除尚未开始执行的任务 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池地址  </td></tr>
    <tr><td class="paramname">destHandleFuncPt</td><td>目标处理函数地址 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00431">431</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8c_source.html#l00025">cleanUpHandle()</a>, <a class="el" href="threads__pool_8h_source.html#l00060">threadsPoolMsg::mtxUn</a>, <a class="el" href="threads__pool_8h_source.html#l00080">READY_CLEAN_UP_AND_LOCK</a>, <a class="el" href="threads__pool_8c_source.html#l00134">removeDestTaskMsg()</a>, <a class="el" href="threads__pool_8h_source.html#l00091">UNLOCK_AND_CANCEL_CLEAN_UP</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00063">threadsPoolMsg::waitingTasksCot</a>.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_a7ebefc9eea4454da73914b2e62c3ef54_cgraph.png" border="0" usemap="#athreads__pool_8c_a7ebefc9eea4454da73914b2e62c3ef54_cgraph" alt=""/></div>
</div>

</div>
</div>
<a id="afbfdf354a44f65186b3dfdd80e566b59" name="afbfdf354a44f65186b3dfdd80e566b59"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afbfdf354a44f65186b3dfdd80e566b59">&#9670;&#160;</a></span>reduceThread()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int reduceThread </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>trdsPolMsgStPt</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>从线程池中移除线程 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池指针</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回0，失败返回-1</dd></dl>
<dl class="section note"><dt>注解</dt><dd>至少保留一个活跃线程 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池信息地址 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00486">486</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8h_source.html#l00064">threadsPoolMsg::activeThreadsCot</a>, <a class="el" href="threads__pool_8c_source.html#l00025">cleanUpHandle()</a>, <a class="el" href="threads__pool_8h_source.html#l00060">threadsPoolMsg::mtxUn</a>, <a class="el" href="threads__pool_8h_source.html#l00080">READY_CLEAN_UP_AND_LOCK</a>, <a class="el" href="threads__pool_8c_source.html#l00298">removeThreadMsg()</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00091">UNLOCK_AND_CANCEL_CLEAN_UP</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool__test_8c_source.html#l00033">main()</a>.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_afbfdf354a44f65186b3dfdd80e566b59_cgraph.png" border="0" usemap="#athreads__pool_8c_afbfdf354a44f65186b3dfdd80e566b59_cgraph" alt=""/></div>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_afbfdf354a44f65186b3dfdd80e566b59_icgraph.png" border="0" usemap="#athreads__pool_8c_afbfdf354a44f65186b3dfdd80e566b59_icgraph" alt=""/></div>
</div>

</div>
</div>
<a id="a8a38ce3bf239e8daae72e3d7f7fc66a7" name="a8a38ce3bf239e8daae72e3d7f7fc66a7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8a38ce3bf239e8daae72e3d7f7fc66a7">&#9670;&#160;</a></span>removeDestTaskMsg()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int removeDestTaskMsg </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>trdsPolMsgStPt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *(*)(void *arg)&#160;</td>
          <td class="paramname"><em>destHandleFuncPt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>移除指定任务信息 </p>
<p>从任务队列中移除指定处理函数的任务信息</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">trdsPolMsgStPt</td><td>线程池指针 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">destHandleFuncPt</td><td>目标处理函数指针</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功找到并移除返回0，未找到返回-1</dd></dl>
<dl class="section note"><dt>注解</dt><dd>此函数假设调用者已持有线程池锁 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池地址  </td></tr>
    <tr><td class="paramname">destHandleFuncPt</td><td>目标处理函数地址 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00134">134</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8h_source.html#l00034">taskMsg::handleFuncArg</a>, <a class="el" href="threads__pool_8h_source.html#l00033">taskMsg::handleFuncPt</a>, <a class="el" href="threads__pool_8h_source.html#l00036">taskMsg::nextTaskMsgStPt</a>, <a class="el" href="threads__pool_8h_source.html#l00035">taskMsg::prevTaskMsgStPt</a>, <a class="el" href="threads__pool_8h_source.html#l00067">threadsPoolMsg::tasksLinkedQueueEntr</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00063">threadsPoolMsg::waitingTasksCot</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool_8c_source.html#l00431">reduceTask()</a>.</p>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_a8a38ce3bf239e8daae72e3d7f7fc66a7_icgraph.png" border="0" usemap="#athreads__pool_8c_a8a38ce3bf239e8daae72e3d7f7fc66a7_icgraph" alt=""/></div>
</div>

</div>
</div>
<a id="a14fc4d285be60008c10b4c2520d770f4" name="a14fc4d285be60008c10b4c2520d770f4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a14fc4d285be60008c10b4c2520d770f4">&#9670;&#160;</a></span>removeThreadMsg()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void removeThreadMsg </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>&#160;</td>
          <td class="paramname"><em>trdsPolMsgStPt</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>从链表中移除线程信息 </p>
<p>从线程链表的尾部移除一个线程信息</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">trdsPolMsgStPt</td><td>线程池指针</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>此函数假设调用者已持有线程池锁 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">trdsPolMsgStPt</td><td>线程池信息地址 </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00298">298</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8h_source.html#l00064">threadsPoolMsg::activeThreadsCot</a>, <a class="el" href="threads__pool_8h_source.html#l00049">threadMsg::nextTrdMsgStPt</a>, <a class="el" href="threads__pool_8h_source.html#l00048">threadMsg::prevTrdMsgStPt</a>, <a class="el" href="threads__pool_8h_source.html#l00062">threadsPoolMsg::shutDown</a>, <a class="el" href="threads__pool_8h_source.html#l00068">threadsPoolMsg::threadsLinkedListEntr</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00047">threadMsg::tid</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool_8c_source.html#l00513">destroyThreadMsgsLinkedList()</a> , 以及 <a class="el" href="threads__pool_8c_source.html#l00486">reduceThread()</a>.</p>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_a14fc4d285be60008c10b4c2520d770f4_icgraph.png" border="0" usemap="#athreads__pool_8c_a14fc4d285be60008c10b4c2520d770f4_icgraph" alt=""/></div>
</div>

</div>
</div>
<a id="a649af44a3d418d82c8be4cc9e28be41d" name="a649af44a3d418d82c8be4cc9e28be41d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a649af44a3d418d82c8be4cc9e28be41d">&#9670;&#160;</a></span>threadRoutine()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void * threadRoutine </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>arg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>线程例程函数 </p>
<p>工作线程的主循环函数，从任务队列获取任务并执行</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">arg</td><td>线程参数（线程池指针）</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>线程退出状态</dd></dl>
<dl class="section note"><dt>注解</dt><dd>此函数会一直运行直到线程池关闭 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">arg</td><td>例程参数（线程池信息地址） </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="threads__pool_8c_source.html">threads_pool.c</a> 第 <a class="el" href="threads__pool_8c_source.html#l00185">185</a> 行定义.</p>

<p class="reference">引用了 <a class="el" href="threads__pool_8c_source.html#l00025">cleanUpHandle()</a>, <a class="el" href="threads__pool_8h_source.html#l00061">threadsPoolMsg::codUn</a>, <a class="el" href="threads__pool_8c_source.html#l00103">dequeueTaskMsg()</a>, <a class="el" href="threads__pool_8h_source.html#l00034">taskMsg::handleFuncArg</a>, <a class="el" href="threads__pool_8h_source.html#l00033">taskMsg::handleFuncPt</a>, <a class="el" href="threads__pool_8h_source.html#l00060">threadsPoolMsg::mtxUn</a>, <a class="el" href="threads__pool_8h_source.html#l00080">READY_CLEAN_UP_AND_LOCK</a>, <a class="el" href="threads__pool_8h_source.html#l00062">threadsPoolMsg::shutDown</a>, <a class="el" href="threads__pool_8h_source.html#l00091">UNLOCK_AND_CANCEL_CLEAN_UP</a> , 以及 <a class="el" href="threads__pool_8h_source.html#l00063">threadsPoolMsg::waitingTasksCot</a>.</p>

<p class="reference">被这些函数引用 <a class="el" href="threads__pool_8c_source.html#l00245">getNewThreadMsg()</a>.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_a649af44a3d418d82c8be4cc9e28be41d_cgraph.png" border="0" usemap="#athreads__pool_8c_a649af44a3d418d82c8be4cc9e28be41d_cgraph" alt=""/></div>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="threads__pool_8c_a649af44a3d418d82c8be4cc9e28be41d_icgraph.png" border="0" usemap="#athreads__pool_8c_a649af44a3d418d82c8be4cc9e28be41d_icgraph" alt=""/></div>
</div>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
生成于 2025年 九月 13日 星期六 03:23:00 , 为 线程池使用 &#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>
